home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14020 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  627 b 

  1. Path: news.opennet.net.au!news
  2. From: george@opennet.net.au (Kenneth H Smith)
  3. Newsgroups: comp.lang.c
  4. Subject: Character string
  5. Date: 11 Apr 1996 10:00:04 GMT
  6. Organization: Mintchester Pty. Ltd.
  7. Message-ID: <4kil74$8i7@Tandem1.opennet.net.au>
  8. NNTP-Posting-Host: bri-du6-3.opennet.net.au
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.99.2
  11.  
  12. How do I do a similar statement in C to the Pascal code:
  13.  
  14. If Ch IN ['a','A'] THEN
  15.  
  16. I want to execute a piece of code when a particular character is entered
  17. from the keyboard.
  18.  
  19. I know I can use if (ch=='a') && (ch=='A') but was looking for something
  20. a little more ellegant.
  21.  
  22. Thanks,
  23.  
  24. Ken Smith.
  25.  
  26.